<?php	
	
	class PowerTabOutputStream {


		protected $m_classCount = 0;
		protected $m_objectId = array ();
		protected $m_stream;
	
		function PowerTabOutputStream ($fileName = NULL) {
	
			if (!$fileName) return 0;
				 
			// Create a stream
			$this->m_stream = fopen($fileName, "wb");
				 
			if (!$this->m_stream)
				return 0;
	
		}
	
		function & GetStream () {
			return $this->m_stream;
		}
	
		function MapObject ($mfcName) {
			$this->m_classCount++;
		
			if (!$this->IsObjectSet($mfcName))
				$this->m_objectId[$mfcName] = (0x8000 | $this->m_classCount);
		}
		
		function IsObjectSet ($mfcName) {
			return (isset($this->m_objectId[$mfcName]));
		}

		function GetObjectId ($mfcName) {
	
			return $this->m_objectId[$mfcName];
		}
		
		function Debug () {
			
			print_r ($this->m_objectId);
		}
		

	}
	
?>